package yz.cp.back.common.enums;

public enum UserAccountStatus {
    NULL(-1,"N/A"),
    N0(1,"正常"),
    N1(2,"冻结");
    private Integer code;
    private String name;

    UserAccountStatus(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static UserAccountStatus getByCode(Integer code){
        for (UserAccountStatus item : values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return UserAccountStatus.NULL;
    }
}
